<template>
  <div class="container" ref="container">

  </div>
</template>

<script>
import * as echarts from 'echarts';

export default {
  name: "EchartsLine",

  mounted() {
    //
    let MyEcharts = echarts.init(this.$refs.container)

    //
    MyEcharts.setOption({
      title:{
        text:'商品分类数据柱状图',
        left:'center'
      },
      tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b} : {c}'
      },
      legend: {
        left: 'left'
      },
      xAxis: {
        type: 'category',
        name: 'x/(day)',
        splitLine: { show: false },
        data: ['1', '2', '3', '4', '5', '6', '7', '8', '9']
      },
      grid: {
        left: '3%',
        right: '6%',
        bottom: '3%',
        containLabel: true
      },
      yAxis: {
        type: 'log',
        name: 'y/(￥)',
        minorSplitLine: {
          show: true
        }
      },
      series: [
        {
          name: 'java',
          type: 'line',
          data: [1, 3, 9, 27, 81, 247, 741, 2223, 6669]
        },
        {
          name: 'Vue',
          type: 'line',
          data: [1, 2, 4, 8, 16, 32, 64, 128, 256]
        },
      ]
    })
  }
}
</script>

<style scoped>
.container{
  width: 100%;
  height: 31vh;
}
</style>